﻿<Window x:Class="Avalon.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xml:lang="en-US"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2006" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
	x:Name="Window"
	Title="Window1"
	Width="640" Height="480">

    <Window.Resources>
        <ControlTemplate x:Key="GlassButton" TargetType="{x:Type Button}">
            <Border BorderBrush="#FFFFFFFF" BorderThickness="1,1,1,1" CornerRadius="4,4,4,4">
                <Border x:Name="border" Background="#7F000000" BorderBrush="#FF000000" BorderThickness="1,1,1,1" CornerRadius="4,4,4,4">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="0.507*"/>
                            <RowDefinition Height="0.493*"/>
                        </Grid.RowDefinitions>
                        <Border Opacity="0" HorizontalAlignment="Stretch" x:Name="glow" Width="Auto" Grid.RowSpan="2" CornerRadius="4,4,4,4">
                            <Border.Background>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform ScaleX="1.702" ScaleY="2.243"/>
                                            <SkewTransform AngleX="0" AngleY="0"/>
                                            <RotateTransform Angle="0"/>
                                            <TranslateTransform X="-0.368" Y="-0.152"/>
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="#B28DBDFF" Offset="0"/>
                                    <GradientStop Color="#008DBDFF" Offset="1"/>
                                </RadialGradientBrush>
                            </Border.Background>
                        </Border>
                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto" Grid.RowSpan="2"/>
                        <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" x:Name="shine" Width="Auto" CornerRadius="4,4,0,0">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.494,0.889" StartPoint="0.494,0.028">
                                    <GradientStop Color="#99FFFFFF" Offset="0"/>
                                    <GradientStop Color="#33FFFFFF" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                        </Border>
                    </Grid>
                </Border>
            </Border>
        </ControlTemplate>
        
        <ControlTemplate x:Key="Top_Navigation_Template" TargetType="{x:Type Button}">
            <Border BorderBrush="Transparent" BorderThickness="0" CornerRadius="5" Name="Border_Icon">
                <Border.Background>
                    <LinearGradientBrush EndPoint="0.494,0.889" StartPoint="0.494,0.028">
                        <GradientStop Color="#99FFFFFF" Offset="0.05"/>
                        <GradientStop Color="#33FFFFFF" Offset="0.5"/>
                        <GradientStop Color="#33FFFFFF" Offset="1"/>
                    </LinearGradientBrush>
                </Border.Background>
                <StackPanel Orientation="Vertical" VerticalAlignment="Top">
                    <Image Source="/image/e_mail.png" Width="65" Height="65"></Image>
                    <TextBlock TextAlignment="Center" FontSize="12" FontWeight="Bold" Foreground="White">收发邮件</TextBlock>
                </StackPanel>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="false">
                    <Setter TargetName="Border_Icon" Property="Background" Value="Transparent"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </Window.Resources>

    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.486,0.986" StartPoint="0.486,0">
                <GradientStop Color="#FF000000" Offset="0"/>
                <GradientStop Color="#FFD0D0D0" Offset="1"/>
                <GradientStop Color="#FF8D8D8D" Offset="0.558"/>
                <GradientStop Color="#FF8D8D8D" Offset="0.76"/>
                <GradientStop Color="#FF747474" Offset="0.615"/>
            </LinearGradientBrush>
        </Grid.Background>
        <Button Width="85" Height="80" Margin="40,2,0,8" Template="{DynamicResource ResourceKey=Top_Navigation_Template}" />
        <Button Width="85" Height="80" Margin="20,2,0,8" Template="{DynamicResource ResourceKey=GlassButton}" />
        <Button Width="85" Height="80" Margin="20,2,0,8" Template="{DynamicResource ResourceKey=Top_Navigation_Template}" />


        <Button Width="176" Height="34" Content="Button" Foreground="#FFFFFFFF" Template="{DynamicResource GlassButton}"/>
        
        <Button Width="179" Height="34" Content="My New Glass Button" Foreground="#FFFFFFFF" Template="{DynamicResource GlassButton}"/>
        <Button Width="179" Foreground="#FFFFFFFF" Template="{DynamicResource GlassButton}" HorizontalAlignment="Right" Margin="0,192,120,218">
         
        </Button>
    </Grid>
</Window>